home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / CAP2.SLT < prev    next >
Text File  |  1990-09-21  |  4KB  |  84 lines

  1. //╔═════════════════════════════════════════════════════════════════════╗
  2. //║ RBBS 17.3A         JW-PC Consulting DataFlex.HST      (608)837-1923 ║
  3. //║ Dual Std HST/V.32/MNP5/V.42     RBBSnet 8:972/2     FIDOnet 1:121/8 ║
  4. //╚═════════════════════════════════════════════════════════════════════╝
  5. // Capture file automation macro - set this to a function key!
  6. //
  7. // By:  James L. Wargula  -  JW-PC Consulting     DataFlex.SIG RBBS
  8. //                           (608)837-1923 BBS    RBBS-Net 8:972/2
  9. //
  10. // Close any open capture file and open a new one based upon a unique file
  11. // name and extension concatenated from the internal clock/calendar functions.
  12. //
  13. // YEAR + MONTH + DAY + HOURS = file name (8-characters)
  14. // MINUTES + SIXTHS OF A MINUTE = file extension (3-characters)
  15. //
  16. // This will enable the user to create a unique name, as long as a minimum
  17. // of 10-seconds have passed since the previous file was opened.  Otherwise
  18. // script macro will re-open existing file and append to it.  Setting a
  19. // function key = @CYC will automate calling this macro and give you
  20. // "instant" unique capture files, within the 10-second limitation.  This
  21. // macro could be modified to exclude the decade, and include full seconds,
  22. // thereby allowing the user a 1-second interval between files.  This macro
  23. // was written to allow archiving of continuous information that could be
  24. // pulled off of a file server by another user after the TELIX user
  25. // "CYCled" the capture file.  In a network situation, the open capture
  26. // file is locked by the primary user when it is open.  Having the macro
  27. // set to a function key allows the user to easily close the existing file
  28. // and open a new one with a unique name.  The unique names can easily be
  29. // sorted sequentially due to the structure of the concatenated name.  The
  30. // file name and extension represent the "opening" date/time stamp, while
  31. // the file time and date stamp represent the "closing" date/time.
  32. //
  33. main()
  34. {
  35. capture("*CLOSE*");                         //close any open capture file.
  36. //
  37. str cap_dir[64]="D:\";                      //Put your capture path here
  38. // note:  path must have trailing back-slash.
  39. //        Use "" (two quotes) if the default directory is preferred.
  40. //
  41. str cap_name[12];
  42. str dat[8];
  43. str tim[8];
  44. str day[2];
  45. str mon[2];
  46. str yea[2];
  47. str hrs[2];
  48. str min[2];
  49. str sec[1];
  50. str message[80];
  51. _time_format = 1;
  52. date(curtime(),dat);                        //Get the string date
  53. substr(dat,3,2,day);                        //Just want the day
  54. substr(dat,0,2,mon);                        //Just want the month
  55. substr(dat,6,2,yea);                        //Just want the year
  56. strcat(cap_name,yea);                       //Add year to cap_name
  57. strcat(cap_name,mon);                       //Add month to cap_name
  58. strcat(cap_name,day);                       //Add day to cap_name
  59. time(curtime(),tim);                        //Get the string time
  60. substr(tim,0,2,hrs);                        //Just want the hours
  61. substr(tim,3,2,min);                        //Just want the minutes
  62. substr(tim,6,1,sec);                        //Just want the 1/6's of minutes
  63. strcat(cap_name,hrs);                       //Add hrs to cap_name
  64. strcat(cap_name,".");                       //Add ext dot to cap_name
  65. strcat(cap_name,min);                       //Add minutes to cap_name
  66. strcat(cap_name,sec);                       //Add sixths of minutes to cap_name
  67. strcat(cap_dir,cap_name);                   //Put path in front of cap_name
  68. strupper(cap_dir);                          //Make it all caps
  69. if (capture(cap_dir) == -1)                 //Try to open capture file,
  70.    {                                        //if error, construct message...
  71.    strcat(message,"ERROR in opening ");
  72.    strcat(message,cap_dir);
  73.    strcat(message," capture file.");
  74.    status_wind(message, 50);                //print message
  75.    }
  76.    else
  77.       {                                     //if OK, construct message...
  78.       strcat(message,"Capture file ");
  79.       strcat(message,cap_dir);
  80.       strcat(message," successfully opened.");
  81.       status_wind(message, 30);             //print message
  82.       }
  83. }
  84.